import request from '@/utils/request';

/**
 * 保存
 * @param {*} params
 */
export const save = params => {
  return request({
    url: '/wx/mp/menu/save',
    data: params,
    method: 'post'
  });
};

/**
 * 更新
 * @param {*} params
 */
export const update = params => {
  return request({
    url: '/wx/mp/menu/update',
    data: params,
    method: 'post'
  });
};

/**
 * 获取
 * @param {*} id
 */
export const get = id => {
  return request({
    url: '/wx/mp/menu/get',
    data: {
      id: id
    },
    method: 'post'
  });
};

/**
 * 删除
 * @param {*} id
 */
export const remove = id => {
  return request({
    url: '/wx/mp/menu/delete',
    data: {
      id: id
    },
    method: 'post'
  });
};

/**
 * 菜单树
 * @param {*} id
 */
export const tree = params => {
  return request({
    url: '/wx/mp/menu/tree',
    data: params,
    method: 'post'
  });
};

/**
 * 同步菜单到公众号
 * @param {*} params
 */
export const sync = params => {
  return request({
    url: '/wx/mp/menu/sync',
    data: params,
    method: 'post'
  });
};
